//
//  JKHomeSectionHeaderView.swift
//  ZhiHuDaily-Swift
//
//  Created by albert on 2018/3/7.
//  Copyright © 2018年 安永博. All rights reserved.
//

import UIKit

class JKHomeSectionHeaderView: JKBaseHeaderFooterView {

    var headerTitle: String? {
        
        didSet{
            
            titleLabel.text = headerTitle
        }
    }
    
    // MARK: - 属性
    
    /** titleLabel */
    private lazy var titleLabel: UILabel = {
        
        let titleLabel = UILabel()
        titleLabel.textColor = UIColor.white
        titleLabel.font = UIFont.systemFont(ofSize: 16)
        titleLabel.textAlignment = NSTextAlignment.center
        contentView.addSubview(titleLabel)
        
        return titleLabel
    }()
    
    // MARK: - 初始化
    
    override func initialization() {
        super.initialization()
        
        contentView.backgroundColor = JKMainColor
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel.frame = bounds
    }
}

extension JKHomeSectionHeaderView {
    
    override func updateSkin() {
        super.updateSkin()
        
        titleLabel.textColor = (skinModel == JKDaySkinModelValue) ? UIColor.white : JKColor(186, 186, 186)
        
        contentView.backgroundColor = (skinModel == JKNightSkinModelValue) ? JKNightSkinNavColor : JKMainColor
    }
}
